% ECG_HISTORY       ECG history
% 
% Function: Input Real-time heartrate or data-filtered heartrate to
%           calculate the the maximum, minimum or standard deviation of
%           heartrate.
%
%           Heart-rate matrix will be pre-processed by this function to
%           remove the FIRST AND LAST 5 seconds of the plot
%           
%           (Default recording time: ~74 seconds +/- 1 second)
%
% Copyright: Group 8
% Modified at 20th Oct 2010
%-------------------------------------------------------------------------
function [max_HR,min_HR,sd_ecg,HR_modified] = ecg_history(HR_real)
%% Function of plotting HR-real against time
% 1. plotting HR_real vs time
% 2. histogram of time

%% Trim the transients
HR_modified = HR_real(5:length(HR_real)-5);
    
 %% Find necessary variables
max_HR = max(HR_modified);
min_HR = min(HR_modified);
sd_ecg = std(HR_modified);